home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.beans.PropertyChangeEvent;
- import java.beans.PropertyChangeListener;
- import javax.swing.ComboBoxModel;
-
- public class BasicComboBoxUI$PropertyChangeHandler implements PropertyChangeListener {
- // $FF: synthetic field
- private final BasicComboBoxUI this$0;
-
- public BasicComboBoxUI$PropertyChangeHandler(BasicComboBoxUI var1) {
- this.this$0 = var1;
- }
-
- // $FF: synthetic method
- static BasicComboBoxUI access$0(BasicComboBoxUI$PropertyChangeHandler var0) {
- return var0.this$0;
- }
-
- public void propertyChange(PropertyChangeEvent var1) {
- String var2 = var1.getPropertyName();
- if (var2.equals("model")) {
- ComboBoxModel var3 = (ComboBoxModel)var1.getNewValue();
- ComboBoxModel var4 = (ComboBoxModel)var1.getOldValue();
- if (var4 != null && this.this$0.listDataListener != null) {
- var4.removeListDataListener(this.this$0.listDataListener);
- }
-
- if (var3 != null && this.this$0.listDataListener != null) {
- var3.addListDataListener(this.this$0.listDataListener);
- }
-
- if (this.this$0.editor != null) {
- this.this$0.comboBox.configureEditor(this.this$0.comboBox.getEditor(), this.this$0.comboBox.getSelectedItem());
- }
-
- this.this$0.isMinimumSizeDirty = true;
- this.this$0.comboBox.revalidate();
- this.this$0.comboBox.repaint();
- } else if (var2.equals("editor") && this.this$0.comboBox.isEditable()) {
- this.this$0.removeEditor();
- this.this$0.addEditor();
- } else if (var2.equals("editable")) {
- if (this.this$0.comboBox.isEditable()) {
- this.this$0.comboBox.setRequestFocusEnabled(false);
- if (this.this$0.popupKeyListener != null) {
- this.this$0.comboBox.removeKeyListener(this.this$0.popupKeyListener);
- }
-
- this.this$0.addEditor();
- if (this.this$0.editor != null) {
- this.this$0.configureEditor();
- }
-
- this.this$0.editorFocusListener = new BasicComboBoxUI.2(this);
- this.this$0.editor.addFocusListener(this.this$0.editorFocusListener);
- } else {
- this.this$0.comboBox.setRequestFocusEnabled(true);
- if (this.this$0.popupKeyListener != null) {
- this.this$0.comboBox.addKeyListener(this.this$0.popupKeyListener);
- }
-
- this.this$0.removeEditor();
- this.this$0.editor.removeFocusListener(this.this$0.editorFocusListener);
- }
-
- this.this$0.updateToolTipTextForChildren();
- this.this$0.comboBox.revalidate();
- this.this$0.comboBox.validate();
- this.this$0.comboBox.revalidate();
- this.this$0.comboBox.repaint();
- } else if (var2.equals("enabled")) {
- boolean var5 = this.this$0.comboBox.isEnabled();
- if (var5) {
- if (this.this$0.editor != null) {
- this.this$0.editor.setEnabled(true);
- }
-
- if (this.this$0.arrowButton != null) {
- this.this$0.arrowButton.setEnabled(true);
- }
- } else {
- if (this.this$0.editor != null) {
- this.this$0.editor.setEnabled(false);
- }
-
- if (this.this$0.arrowButton != null) {
- this.this$0.arrowButton.setEnabled(false);
- }
- }
-
- this.this$0.comboBox.repaint();
- } else if (var2.equals("maximumRowCount")) {
- if (this.this$0.isPopupVisible(this.this$0.comboBox)) {
- this.this$0.setPopupVisible(this.this$0.comboBox, false);
- this.this$0.setPopupVisible(this.this$0.comboBox, true);
- }
- } else if (var2.equals("font")) {
- this.this$0.listBox.setFont(this.this$0.comboBox.getFont());
- if (this.this$0.editor != null) {
- this.this$0.editor.setFont(this.this$0.comboBox.getFont());
- }
-
- this.this$0.isMinimumSizeDirty = true;
- this.this$0.comboBox.validate();
- } else if (var2.equals("ToolTipText")) {
- this.this$0.updateToolTipTextForChildren();
- } else if (var2.equals("JComboBox.lightweightKeyboardNavigation")) {
- Object var6 = var1.getNewValue();
- if (var6.equals("Lightweight")) {
- BasicComboBoxUI.access$1(this.this$0, true);
- } else if (var6.equals("Heavyweight")) {
- BasicComboBoxUI.access$1(this.this$0, false);
- }
- }
-
- }
- }
-